﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using MISAPP.Classify.DataAccess;
using MISAPP.MISInterface;

namespace MISAPP.Classify.Service
{
    public class Service_CFG004
    {
        protected DA_CFG004 da = null;
        protected DA_CFG004 DA
        {
            get
            {
                if (da == null)
                {
                    da = new DA_CFG004();
                }
                return da;
            }
        }

        public string[] CardCategory = { "BANK卡"
            , "認同卡", "聯名卡", "公務採購卡" };

        public string[] Rows = { "PROD_CATEGORY_L3", "當月新增簽帳金額" };


        public string[] GetCardCellRange(string p_category)
        {           
            string str =DA.GetCardRange(p_category);
            return str.Split(new char[] { ':'});
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="p_category">卡片類別</param>
        /// <param name="p_card">卡片</param>
        /// <param name="p_ym">TW YYYMM</param>
        /// <param name="p_amount">金額</param>
        /// <returns></returns>
        public bool Insert(string p_category, string p_ym
            , object[,] p_amount,object[,] p_card)
        {
            return DA.Insert(p_category, p_card, p_ym, p_amount);
        }

        public DataTable GetSummaryData(string p_yyy)
        {
            //string ym = (DateTime.Now.Year - 1911).ToString();
            return DA.GetSummaryData(p_yyy);
        }

        public void Check(string p_ym)
        {
            DA.Check(p_ym);
        }

    }
}
